package work.shyk;

/**
 * description: <br>
 * createTime: 2018/11/2814:09 <br>
 *
 * @author zzh
 */
public class TestSingle {
    private boolean initalized = false;
    private TestSingle() {
        synchronized (TestSingle.class) {
            if(initalized == false) {
                initalized = !initalized;
            } else {
                throw new RuntimeException("单例被入侵了");
            }
        }
    }

    public static final TestSingle getInstance() {
        return null;
    }

//    public static final class InstanceHolder{
//        public static
//    }
}
